package com.harmony.pilot.knowledge.repository;

import com.harmony.pilot.knowledge.entity.GnSourceMapping;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * GN源文件映射Repository
 */
@Repository
public interface GnSourceMappingRepository extends JpaRepository<GnSourceMapping, Long> {
    
    List<GnSourceMapping> findByGnTargetId(Long gnTargetId);
    
    List<GnSourceMapping> findBySourceFilePath(String sourceFilePath);
    
    Optional<GnSourceMapping> findByGnTargetIdAndSourceFilePath(Long gnTargetId, String sourceFilePath);
    
    boolean existsByGnTargetIdAndSourceFilePath(Long gnTargetId, String sourceFilePath);
    
    List<GnSourceMapping> findByGnFilePath(String gnFilePath);
    
    List<GnSourceMapping> findByTargetName(String targetName);
}

